package servlet;

import javabean.db_conn;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class change_order2 extends HttpServlet {
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {

        String F_n = req.getParameter("F_n");
        String id = req.getParameter("id");
        System.out.println(id+"  "+F_n);
        db_conn conn = new db_conn();
        String sql = "update t_order set useful = 2 where id = '"+id+"'";
        int i =conn.Update(sql);
        System.out.println(i);
        resp.sendRedirect("default/order.jsp?flight_id="+F_n+"&grade=f");
    }
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        doPost(req,resp);
    }
}
